<?php

    include 'config.php';
    
    $navigation[] = array('index.php', 'Home');
    $navigation[] = array('notifications.php', 'Alle Mitteilungen');
    $navigation[] = array('tasks.php', 'Alle Aufgaben');
    
    include 'process/addnotification.php';
    include 'process/addtask.php';
    include 'process/archivenotification.php';
    include 'process/archivetask.php';

?>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
        <link rel="stylesheet" href="style/blitzer/jquery-ui-1.8.23.custom.css" media="all" />
        <link rel="stylesheet" href="style/style.css" media="all" />
        <script type="text/javascript" src="js/jquery-1.8.0.min.js"></script>
        <script type="text/javascript" src="js/jquery-ui-1.8.23.custom.min.js"></script>
        <script type="text/javascript" src="js/script.js"></script>
        <title><?php echo $config['title']; ?></title>
    </head>
    <body>
        <div id="wrapper">
            <div id="top">
                <img id="logo" src="<?php echo $config['logo']; ?>" />
                <h1><?php echo strtoupper($config['title']); ?></h1>
            </div>
            <div id="navigation">
                <?php
                    foreach($navigation as $nav){
                        echo '<a href="'.$nav[0].'" ';
                        if(strpos($_SERVER['SCRIPT_NAME'], $nav[0])){
                            echo 'class="active"';
                        }
                        echo '>'.$nav[1].'</a>';
                    }
                ?>
                
                <a onClick="toggleAdd();" href="#" class="right">Neue Mitteilung</a>
                <a onClick="toggleAddTask();" href="#" class="right">Neue Aufgabe</a>
            </div>
            
            <?php
            
            include 'form/addtask.php';
            include 'form/addnotification.php';
            
            // Success and Error
            if(isset($error) && count($error) > 0){
                foreach($error as $e){
                    echo '<div class="error">'.$e.'</div>';
                }
            }

            if(isset($success) && count($success) > 0){
                foreach($success as $s){
                    echo '<div class="success">'.$s.'</div>';
                }
            }
            
            ?>
